<%--
  Created by IntelliJ IDEA.
  User: MyPC
  Date: 2024/12/11
  Time: 17:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <jsp:include page="resources.jsp"/>
</head>
<body>
<div id="dcWrap">
    <div id="dcHead">
        <jsp:include page="head.jsp"/>
    </div>
    <!-- dcHead 结束 -->
    <div id="dcLeft">
        <jsp:include page="menu.jsp"/>
    </div>
    <div id="dcMain">
        <!-- 当前位置 -->
        <div id="urHere">快递管理系统<b>></b><strong>编辑快递</strong></div>
        <div
                id="manager" class="mainBox"
                style="height:auto!important;height:550px;min-height:550px;">
            <h3><a href="/index.jsp" class="actionBtn">返回首页</a>编辑快递</h3>

            <form action="/delivery/RealUpdate" method="post" id="editForm">
                <!-- 修改的参照id-->

                <input type="hidden" name="id" value="${delivery.id}"/>
                <table width="100%" border="0" cellpadding="8" cellspacing="0"
                       class="tableBasic">
                    <tr>
                        <td width="100" align="right">收件人</td>
                        <td>
                            <input type="text" name="user_name" size="40"
                                   class="inpMain" value="${delivery.deliveryName}"/>
                        </td>
                    </tr>
                    <tr>
                        <td width="100" align="right">快递公司</td>
                        <td>
                            <select name="cat_id" id="company">
                                <option value="0">请选择</option>
                                <option value="1" ${delivery.companyId == 1 ? 'selected' : ''}> 顺丰快递</option>
                                <option value="2" ${delivery.companyId == 2 ? 'selected' : ''}> 圆通快递</option>
                                <option value="3" ${delivery.companyId == 3 ? 'selected' : ''}> 中通快递</option>
                                <option value="4" ${delivery.companyId == 4 ? 'selected' : ''}> 申通快递</option>
                                <option value="5" ${delivery.companyId == 5 ? 'selected' : ''}> 韵达快递</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td width="100" align="right">手机号</td>
                        <td>
                            <input type="text" size="40" name="phone" class="inpMain" value="${delivery.phone}"/>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">收货地址</td>
                        <td>
                            <input type="text" name="password" size="40"
                                   class="inpMain" value="${delivery.address}"/>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">收货日期</td>
                        <td>
                            <input type="date" name="date" size="40" class="inpMain"
                                   placeholder="yyyy-MM-dd" value="${delivery.sendTime}"/>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">收货状态</td>
                        <td>
                            <input type="radio" name="a" size="40" value="1" ${delivery.state == 1 ? 'checked' : ''}/> 已签收
                            <input type="radio" name="a" size="40" value="0" ${delivery.state == 0 ? 'checked' : ''}/> 未签收
                        </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <input type="submit" name="submit" class="btn" value="提交"/>
                        </td>
                    </tr>
                </table>

            </form>
        </div>
    </div>
    <div class="clear"></div>
    <div id="dcFooter">
        <div id="footer">
            <div class="line"></div>
            <ul>
                版权所有 © 2024-2025 尚硅谷教育，并保留所有权利。
            </ul>
        </div>
    </div><!-- dcFooter 结束 -->
    <div class="clear"></div>
</div>
<script>
    const form = document.getElementById("editForm");
    const selectCompany = document.getElementById("company");
    form.onsubmit = function () {
        if(selectCompany.value==0){
            alert("请选择快递公司!");
            return false;
        }
    }
</script>
</body>
</html>
